package com.lds.config.center.server.business.cluster.converter;

import com.lds.config.center.common.model.cluster.request.ClusterBaseGetByKeyRequest;
import com.lds.config.center.server.business.cluster.entity.Cluster;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class ClusterBaseGetByKeyRequestToEntityConverter implements Converter<ClusterBaseGetByKeyRequest, Cluster> {

    @Override
    public Cluster convert(ClusterBaseGetByKeyRequest source) {
        return Cluster.builder()
                .name(source.getName())
                .envId(source.getEnvId())
                .build();
    }

}